package com.gopay.scheduler.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.cust.CustCaBuyDtl;
import com.gopay.scheduler.dao.CustCaBuyDtlReadDao;
@Repository("custCaBuyDtlReadDao")
public class CustCaBuyDtlReadDaoImpl extends BaseDAOImpl<CustCaBuyDtl,Long> implements CustCaBuyDtlReadDao {

    @Override
    public List<CustCaBuyDtl> showCustCaBuyDtlByTimeAndDtlType(String currrentTs) {
        Map<String,Object> param = new HashMap<String,Object>();
        String hql = "select ccbd from CustCaBuyDtl ccbd"
                    +" where to_char(ccbd.installExpireTs,'yyyy-MM-dd') <= :currentTs and ccbd.unusedCount>0";
        param.put("currentTs", currrentTs);
        return super.findByHql(hql,param);
    }

}
